package com.ilxqx.framework.amqp.entity;

import com.ilxqx.framework.amqp.enumeration.SysMessageLogStatusEnum;
import com.ilxqx.framework.system.entity.anno.Excel;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 系统消息日志实体类
 * @author venus
 */
@Entity(name = "sys_message_log")
@Data
@DynamicInsert
@DynamicUpdate
public class SysMessageLog implements Serializable {

    private static final long serialVersionUID = -672633745056776486L;

    /**
     * 任务主键
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long messageId;

    /**
     * 标题
     */
    @Excel(value = "标题")
    private String title;

    /**
     * 任务内容
     */
    @Excel(value = "内容")
    private String content;

    /**
     * 状态
     */
    @Excel(value = "状态", method = "getMeaning")
    private SysMessageLogStatusEnum status;

    /**
     * 重试次数
     */
    @Excel(value = "重试次数")
    private Integer tryCount;

    /**
     * 下次重试时间
     */
    @Excel(value = "下次重试时间")
    private LocalDateTime nextRetryTime;

    /**
     * 操作用户ID
     */
    private Long operationUserId;

    /**
     * 操作用户
     */
    @Excel(value = "操作用户")
    private String operationUserName;

    /**
     * 创建时间
     */
    @Excel(value = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @Excel(value = "更新时间")
    private LocalDateTime updateTime;

}